package zl.readcloud.dao;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import zl.readcloud.controller.front.vo.ShelfVO;
import zl.readcloud.pojo.ShelfPO;

import java.util.List;

/**
 * @author ZhangLei
 * @date 2021/10/21 18:09
 */
public interface ShelfDao {

    @Select("select bsId, uAccount, cId, bId, endTiem from book_shelf where uAccount = #{uAccount}")
    List<ShelfPO> getBookShelf(@Param("uAccount") int uAccount);

    @Select("SELECT b.bId, b.bTitle, b.cate, b.author, b.updateTime, c.cTitle " +
            "FROM book_shelf bs " +
            "   INNER JOIN book b ON b.bId = bs.bId " +
            "   INNER JOIN chapter c ON b.bId = c.bId " +
            "WHERE bs.uAccount = #{uAccount} ")
    List<ShelfVO> getBookShelfList(@Param("uAccount") int uAccount);



}
